<ui:component xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:richx="http://richfaces.org/richx">

	<a4j:keepAlive beanName="selectPropertyHelper"/>
	<rich:modalPanel id="selectPropertyPanel" width="480" height="400" zindex="10000">
		<f:facet name="header">
			<h:outputText value="Seleccionar predio"/>
		</f:facet>
		<h:form>
			<!-- a4j:region renderRegionOnly="true"-->
				<rich:extendedDataTable id="selectPropertyTable" value="#{selectPropertyHelper.dataModel}"
						var="property" rows="10" height="330px" selectionMode="single" enableContextMenu="false"
						selection="#{selectPropertyHelper.propertySelection}">
					<f:facet name="header">
						<h:outputText value="Filtre por cualquier atributo"/>
					</f:facet>
					<f:facet name="footer">
						<rich:datascroller selectedStyle="font-weight:bold"/>
					</f:facet>
					<rich:column filterBy="#{property.fieldTab}" filterEvent="onkeyup">
						<f:facet name="header">
							<h:outputText value="Ficha de campo"/>
						</f:facet>
						<h:outputText value="#{property.fieldTab}" />
					</rich:column>
					<rich:column filterBy="#{property.cadastralKey}" filterEvent="onkeyup">
						<f:facet name="header">
							<h:outputText value="Clave catastral"/>
						</f:facet>
						<h:outputText value="#{property.cadastralKey}" />
					</rich:column>
					<rich:column filterBy="#{property.name}" filterEvent="onkeyup">
						<f:facet name="header">
							<h:outputText value="Nombre"/>
						</f:facet>
						<h:outputText value="#{property.name}" />
					</rich:column>
					<rich:column filterBy="#{property.type}" filterEvent="onkeyup">
						<f:facet name="header">
							<h:outputText value="Tipo"/>
						</f:facet>
						<h:outputText value="#{resBundle.loadMessage(property.type)}" />
					</rich:column>
				</rich:extendedDataTable>
				<br/>
				<a4j:commandButton id="acceptProperty" value="#{messages['button.ok']}"
						actionListener="#{selectPropertyHelper.takeSelection}"
						oncomplete="#{rich:component('selectPropertyPanel')}.hide()"
						reRender="#{selectPropertyHelper.reRenderComponents}">
				</a4j:commandButton>
				<a4j:commandButton value="#{messages['button.cancel']}" onclick="#{rich:component('selectPropertyPanel')}.hide()"/>
			<!-- /a4j:region-->
		</h:form>
	</rich:modalPanel>

</ui:component>
